package cn.com.taiji.oospub.wechat.service.impl;

import cn.com.taiji.oospub.wechat.entity.CourseNotes;
import cn.com.taiji.oospub.wechat.mapper.CourseNotesMapper;
import cn.com.taiji.oospub.wechat.service.ICourseNotesService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2021-02-04
 */
@Service
public class CourseNotesServiceImpl extends ServiceImpl<CourseNotesMapper, CourseNotes> implements ICourseNotesService {
    @Autowired
    private CourseNotesMapper courseNotesMapper;

    @Override
    public List<CourseNotes> listDanXuan(String courseTypeId) {
        QueryWrapper<CourseNotes> CourseNotesWrapper = new QueryWrapper<>();
        CourseNotesWrapper.eq("is_delete", "0");
        CourseNotesWrapper.eq("course_type_id", courseTypeId);
        CourseNotesWrapper.eq("type","0");
        return courseNotesMapper.selectList(CourseNotesWrapper);
}

    @Override
    public List<CourseNotes> listDuoXuan(String courseTypeId) {
        QueryWrapper<CourseNotes> CourseNotesWrapper = new QueryWrapper<>();
        CourseNotesWrapper.eq("is_delete", "0");
        CourseNotesWrapper.eq("course_type_id", courseTypeId);
        CourseNotesWrapper.eq("type","1");
        return courseNotesMapper.selectList(CourseNotesWrapper);
    }
}
